<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BPEvent
 *
 * @author i062261
 */
class BAEventSheet extends BTreeTable {

    public function __construct($owner = NULL, $tableName = NULL, $appId = NULL) {
        $treeItem = new BAMeta();
        if ($owner == NULL) {
            $owner = Blyn::app()->getActiveSpace();
        }

        if ($owner instanceof BSpace && $owner->getId() != NULL) {
            $treeItem->spaceId = $owner->getId();
        }

        if ($owner instanceof BApp && $owner->getId() != NULL) {
            $treeItem->appId = $owner->getId();
        }

        if ($appId != NULL) {
            $treeItem->appId = $appId;
        }

        if ($tableName == NULL) {
            $tableName = 'event';
        }

        parent::__construct($treeItem, $owner, $tableName);
    }

}
